import type { Component } from 'vue'
import utils from '@/utils'

// All TSX files under the views folder automatically generate mapping relationship
const modules = import.meta.glob('/src/views/**/**.tsx')
const components: { [key: string]: Component } = utils.mapping(modules)

export default {
  path: '/system',
  name: 'system',
  meta: { title: '系统管理' },
  redirect: { name: 'organization' },
  component: () => import('@/layouts/content'),
  children: [
    {
      path: '/system/organization',
      name: 'organization',
      component: components['system-organization'],
      meta: {
        title: '系统管理-organization',
        activeMenu: 'system',
        showSide: true,
        auth: []
      }
    },
    {
      path: '/system/role',
      name: 'role',
      component: components['system-role'],
      meta: {
        title: '系统管理-role',
        activeMenu: 'system',
        showSide: true,
        auth: []
      }
    },
    {
      path: '/system/menus',
      name: 'menus',
      component: components['system-menus'],
      meta: {
        title: '系统管理-menus',
        activeMenu: 'system',
        showSide: true,
        auth: []
      }
    },
    {
      path: '/system/user',
      name: 'user',
      component: components['system-user'],
      meta: {
        title: '系统管理-user',
        activeMenu: 'system',
        showSide: true,
        auth: []
      }
    },
    {
      path: '/system/log',
      name: 'log',
      component: components['system-log'],
      meta: {
        title: '系统管理-log',
        activeMenu: 'system',
        showSide: true,
        auth: []
      }
    }
  ]
}
